#!/bin/bash

# only info, compile it under windows, no cross compiling

cat << EOF

# set QTDIR=d:/path/to/qt-everywhere-opensource-src-4.7.1


# qt 4.8.4 does not need this
# Please apply the patch first, run :
# shell> patch -p1 -d <QTDIR> < patch/qt-4.7.1-w64.patch
# FIXME : built qmake need add "-ladvapi32"

Build qt with following commands :

shell> configure -release -opensource -platform win32-g++ -fast -no-dsp -no-vcproj -no-webkit -no-phonon -no-phonon-backend -nomake examples -nomake demos
shell> mingw32-make

then, copy libgcc_s_sjlj-1.dll ( or libgcc_s_seh-1.dll ) and libstdc++-6.dll to bin


When use QT4, set following environ values :
QTDIR     : set to root directory of qt4 source
PATH      : add qt tools ( such as qmake ) bin directory ( <QTDIR>/bin ) to PATH
QMAKESPEC : set to "win32-g++"


If you want to move QT4 to another directory, you need to run qpatch to adjust files,
qpatch is located in qt-creator-1.3.1-src/src/tools/qpatch, run :

shell> qpatch files-to-patch-windows <old dir> <new dir>


when release, remove obj directory, remove doc directory, 7zip it


qt-creator 2.7.0 build, just type qmake qtcreator.pro, then make, then make docs
then, copy qt-4.8.4/bin/*.dll to bin

EOF

